package net.dgg.iboss.sc.backservice.task.util;

/**
 * 公共
 * 
 * @author maoquanyi <tanghom@qq.com> 2018-8-17
 */
public class StringUtils {


	/**
	 * 判断变量是否为空
	 * 
	 * @param s
	 * @return
	 */
	public static boolean isEmpty(String s) {
		if (null == s || "".equals(s) || "".equals(s.trim()) || "null".equalsIgnoreCase(s)) {
			return true;
		} else {
			return false;
		}
	}

	/**
	 * 判断变量是否为空
	 *
	 * @param obj
	 * @return
	 */
	public static boolean isEmpty(Object obj) {
		if (null == obj || "".equals(obj.toString()) || "".equals(obj.toString().trim()) || "null".equalsIgnoreCase(obj.toString())) {
			return true;
		} else {
			return false;
		}
	}

	/**
	 * 判断变量是否为空
	 * 
	 * @param s
	 * @return
	 */
	public static boolean isNotEmpty(String s) {
		if (null == s || "".equals(s) || "".equals(s.trim()) || "null".equalsIgnoreCase(s)) {
			return false;
		} else {
			return true;
		}
	}

	/**
	 * 判断变量是否为空
	 * @param obj
	 * @return
     */
	public static boolean isNotEmpty(Object obj){
		if(null == obj || "".equals(obj.toString()) || "".equals(obj.toString().trim()) || "null".equalsIgnoreCase(obj.toString())){
			return false;
		} else {
			return true;
		}
	}


}
